package com.example.jsonformateapplication.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ApiResponseDate<T> {
    private  String code;  //响应状态码
    private String errorMsg;//用于封装异常信息的对象
    private Boolean result;
    private T date;  //封装泛型数据
    private static <T> ApiResponseDate<T> success(T data){
        return new ApiResponseDate<>("200","success",true,data);
    }
    public static <T> ApiResponseDate<T> error(String msg){
        return new ApiResponseDate<>("500",msg,false,null);
    }
}
